﻿using System.Windows.Data;

namespace ResPackClient
{
    [ValueConversion(typeof(int), typeof(bool))]
    public class IndexToBool : IValueConverter
    {
        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int index = (int)value;

            //index == -1 aucune selection
            if (index < 0)
            {
                return false;
            }

            return true;
        }

        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new System.NotImplementedException();
        }
    }
}